import Vue from 'vue'
import Router from 'vue-router'

import Layout from '@/views/layout'
Vue.use(Router)

export const constantRoutes = [
  { path: '/login', component: () => import('@/views/login/index'), hidden: true },
  { path: '/404', component: () => import('@/views/404'), hidden: true },
  {
    path: '/',
    component: Layout,
    redirect: '/dashboard',
    meta: {
      title: '图表',
      icon: 'form',
      roles: ['admin', 'editor'] // you can set roles in root nav
    },
    children: [
      {
        path: 'dashboard',
        name: 'dashboard',
        component: () => import('@/views/dashboard/index'),
        meta: {
          title: 'echarts',
          /* icon: 'form',*/
          roles: ['admin', 'editor'] // you can set roles in root nav
        }
      },
      {
        path: 'cssCanvas',
        name: 'cssCanvas',
        component: () => import('@/views/dashboard/cssChart'),
        meta: {
          title: 'cssCanvas',
          /* icon: 'form',*/
          roles: ['admin', 'editor'] // you can set roles in root nav
        }
      },
      {
        path: 'circularMouse',
        name: 'circularMouse',
        component: () => import('@/views/dashboard/circularMouse'),
        meta: {
          title: 'circularMouse',
          /* icon: 'form',*/
          roles: ['admin', 'editor'] // you can set roles in root nav
        }
      }
    ]
  },
  { path: '*', redirect: '/404', hidden: true }

]

export default new Router({
  // mode: 'history',
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRoutes
})

export const asyncRoutes = [

]

